﻿Option Explicit On
Option Strict On

''' <summary>
''' Clase factura: Para almacenar los datos de una factura
''' </summary>
''' <author>Héctor Pastor</author>

Public Class Factura
    Private _codigo As Integer
    Private _codigo_cita As Integer
    Private _cobro As Single
    Private _descuento As Single
    Private _fecha As DateTime


    Public Sub New()

        _codigo = 0
        _codigo_cita = 0
        _cobro = 0
        _descuento = 0
        _fecha = #1/1/2001#
    End Sub

    Public Sub New(ByVal nuevoCodigo As Integer, ByVal nuevoCodigoCita As Integer, _
                   ByVal nuevoCobro As Single, ByVal nuevoDescuento As Single, _
                   ByVal nuevaFecha As DateTime)

        _codigo = nuevoCodigo
        _codigo_cita = nuevoCodigoCita
        _cobro = nuevoCobro
        _descuento = nuevoDescuento
        _fecha = nuevaFecha
    End Sub

    Public Property Fecha As DateTime
        Get
            Return _fecha
        End Get
        Set(ByVal value As DateTime)
            _fecha = value
        End Set
    End Property

    Public Property Codigo As Integer
        Get
            Return _codigo
        End Get
        Set(ByVal value As Integer)
            _codigo = value
        End Set
    End Property

    Public Property CodigoCita As Integer
        Get
            Return _codigo_cita
        End Get
        Set(ByVal value As Integer)
            _codigo_cita = value
        End Set
    End Property

    Public Property Cobro As Single
        Get
            Return _cobro
        End Get
        Set(ByVal value As Single)
            _cobro = value
        End Set
    End Property

    Public Property Descuento As Single
        Get
            Return _descuento
        End Get
        Set(ByVal value As Single)
            _descuento = value
        End Set
    End Property


    'Destructores
    Protected Overrides Sub Finalize()

        _codigo = -1
        _codigo_cita = -1
        _cobro = -1
        _descuento = -1
        _fecha = #1/1/2001#

    End Sub

    Public Sub Dispose()

        _codigo = -1
        _codigo_cita = -1
        _cobro = -1
        _descuento = -1
        _fecha = #1/1/2001#
    End Sub



End Class
